﻿using Glorysoft.EAP.Contracts.SMECMESClient.Entities;
using Glorysoft.EAP.Core.Entities;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace Glorysoft.EAP.Contracts.MESClient.Models
{

    [XmlRoot("")]
    public class LotinfoResponse : BaseResponses
    {
        [XmlElement("lotBaseInfo")]
        public lotBaseInfo lotBaseInfo = new lotBaseInfo();
        [XmlElement("mvOutParameterSet")]
        public mvOutParameterSet mvOutParameterSetInfo = new mvOutParameterSet();
        [XmlElement("rcflag")]
        public string rcflag { get; set; }
    }
    public class lotBaseInfo
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        [XmlElement("eqptID")]
        public string eqptID { get; set; }

        [XmlElement("batchId")]
        public string batchId { get; set; }

        [XmlElement("lotId")]
        public string lotId { get; set; }

        [XmlElement("lotType")]
        public string lotType { get; set; }

        /// <summary>
        /// 产品号
        /// </summary>
        [XmlElement("productId")]
        public string productId { get; set; }

        /// <summary>
        /// 工步
        /// </summary>
        [XmlElement("operationId")]
        public string operationId { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [XmlElement("qty1")]
        public string qty1 { get; set; }

        /// <summary>
        /// recipe
        /// </summary>
        [XmlElement("recipeId")]
        public string recipeId { get; set; }

        /// <summary>
        /// ppid
        /// </summary>
        [XmlElement("ppid")]
        public string ppid { get; set; }

        /// <summary>
        /// recipeLogicalRrn
        /// </summary>
        [XmlElement("recipeLogicalRrn")]
        public string recipeLogicalRrn { get; set; }

        /// <summary>
        /// reticleGroupId
        /// </summary>
        [XmlElement("reticleGroupId")]
        public string reticleGroupId { get; set; }

        /// <summary>
        /// reticleGroupRrn
        /// </summary>
        [XmlElement("reticleGroupRrn")]
        public string reticleGroupRrn { get; set; }


        /// <summary>
        /// Unit信息
        /// </summary>
        [XmlArray("UnitList")]
        [XmlArrayItem("unitsInfo")]
        public List<unitsInfo> UnitList = new List<unitsInfo>();

        /// <summary>
        /// lot状态
        /// </summary>
        [XmlElement("lotStatus")]

        public string lotStatus { get; set; }


        /// <summary>
        /// lot状态
        /// </summary>
        [XmlElement("stageId")]

        public string stageId { get; set; }


        /// <summary>
        /// priority
        /// </summary>
        [XmlElement("priority")]

        public string priority { get; set; }


        /// <summary>
        /// processId
        /// </summary>
        [XmlElement("processId")]

        public string processId { get; set; }

        [XmlElement("customerLotId")]
        public string customerLotId { get; set; }



    }

    public class unitsInfo
    {
        [XmlElement("position")]
        public string position { get; set; }
        [XmlElement("unitstatus")]
        public string unitstatus { get; set; }
        [XmlElement("unitId")]
        public string unitId { get; set; }
        [XmlElement("t7code")]
        public string t7code { get; set; }
    }
    public class mvOutParameterSet
    {
        [XmlElement("parameterSetRrn")]
        public string parameterSetRrn { get; set; }

        [XmlElement("parameterSetSpecRrn")]
        public string parameterSetSpecRrn { get; set; }

        [XmlElement("parameterSetVersion")]
        public string parameterSetVersion { get; set; }

        [XmlElement("parameterSize")]
        public string parameterSize { get; set; }
        /// <summary>
        /// SamplePrompts信息
        /// </summary>
        [XmlElement("parameters")]
        public List<parameters> parameters = new List<parameters>();
        //public List<parameters> parametersinfo = new List<parameters>();
    }
    public class parameters
    {
        [XmlElement("parameterId")]
        public string parameterId { get; set; }

        [XmlElement("parameterRrn")]
        public string parameterRrn { get; set; }

        [XmlElement("parameterSequence")]
        public string parameterSequence { get; set; }

        [XmlElement("samplePromptSize")]
        public string samplePromptSize { get; set; }

        [XmlArray("SamplePrompts")]
        [XmlArrayItem("samplePrompts")]
        public List<samplePrompts> samplePrompts = new List<samplePrompts>();

    }
    public class samplePrompts
    {
        [XmlElement("position")]
        public string position { get; set; }

        [JsonProperty("readingPrompts")]
        [XmlElement("readingPrompts")]
        public List<readingPrompts> readingPrompts = new List<readingPrompts>();

        [XmlElement("recipeId")]
        public string recipeId { get; set; }

        [XmlElement("sampleId")]
        public string sampleId { get; set; }

        [XmlElement("sampleRrn")]
        public string sampleRrn { get; set; }

        [XmlElement("sampleSequence")]
        public string sampleSequence { get; set; }

        [XmlElement("sampleValue")]
        public string sampleValue { get; set; }

        [XmlElement("readingPromptSize")]
        public string readingPromptSize { get; set; }


        [XmlElement("unitId")]
        public string unitId { get; set; }

        [XmlElement("unitRrn")]
        public string unitRrn { get; set; }

    }
    public class readingPrompts
    {
        [XmlElement("readingRrn")]
        public string readingRrn { get; set; }

        [XmlElement("dataValue")]
        public string dataValue { get; set; }

        [XmlElement("readingId")]
        public string readingId { get; set; }

        [XmlElement("readingSequence")]
        public string readingSequence { get; set; }
    }




}
